local rolely_hengzheng = fk.CreateSkill {
    name = "rolely_hengzheng",
}
Fk:loadTranslationTable {
    ["rolely_hengzheng"] = "横征",
    [":rolely_hengzheng"] = "准备阶段开始时，你可以随机获得敌方角色共计三张牌，然后跳过摸牌阶段，若获得的牌中包含基本牌，本回合你使用【杀】的次数+1；包含非基本牌，你本回合使用非基本牌时，摸一张牌。",

    ["@rolely_hengzheng-turn"] = "横征",
    ["yesbasic"] = "杀",
    ["notbasic"] = "摸",

    ["$rolely_hengzheng1"] = "君为鱼肉，我为刀俎，何如皆吾所欲也！",
    ["$rolely_hengzheng2"] = "入主长安之日，为所欲为之时！",

}
rolely_hengzheng:addEffect(fk.EventPhaseStart, {
    can_trigger = function(self, event, target, player, data)
        return player:hasSkill(rolely_hengzheng.name) and target == player and player.phase == Player.Start
    end,
    on_cost = function(self, event, target, player, data)
        return player.room:askToSkillInvoke(player, { skill_name = rolely_hengzheng.name, prompt = "横征：是否获取其他角色共计三张牌？" })
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        local ids = {}
        local basic = false
        local notbasic = false
        local targets = room:getOtherPlayers(player)
        for _ = 1, 3, 1 do
            local id = table.random(targets)
            if not id.dead and not id:isNude() then
                local i = table.random(id:getCardIds("he"))
                table.insert(ids, i)
            end
        end
        for _, card in ipairs(ids) do
            local cid = Fk:getCardById(card)
            if cid.type == Card.TypeBasic then
                basic = true
            end
            if cid.type ~= Card.TypeBasic then
                notbasic = true
            end
        end
        room:obtainCard(player, ids, false, fk.ReasonPrey, player)
        if basic == true then
            room:addPlayerMark(target, MarkEnum.SlashResidue .. "-turn", 1)
        end
        if notbasic == true then
            room:addTableMarkIfNeed(player, "@rolely_hengzheng-turn", "notbasic")
        end
    end,
})
rolely_hengzheng:addEffect(fk.EventPhaseChanging, {
    mute = true,
    is_delay_effect = true,
    can_trigger = function(self, event, target, player, data)
        return
            target == player and
            data.phase == Player.Draw and
            not data.skipped and
            #player:getTableMark("@rolely_hengzheng-turn") > 0
    end,
    on_use = function(self, event, target, player, data)
        data.skipped = true
    end,
})
rolely_hengzheng:addEffect(fk.CardUsing, {
    can_trigger = function(self, event, target, player, data)
        local mark = player:getTableMark("@rolely_hengzheng-turn")
        return player:hasSkill(rolely_hengzheng.name) and target == player and table.contains(mark, "notbasic") and
            data.card and data.card.type ~= Card.TypeBasic
    end,
    on_cost = Util.TrueFunc,
    on_use = function(self, event, target, player, data)
        player:drawCards(1, rolely_hengzheng.name)
    end,
})


return rolely_hengzheng
